/**
 *
 * 匿名对象的使用
 *
 *
 *
 * */


package OrientProject;

public class ObjectTest1 {
    public static void main(String[] args) {
        Phone p = new Phone();
        System.out.println(p);
        p.playGame();
        p.sendEmain();

        //匿名对象
        new Phone().sendEmain();
        new Phone().playGame();
    }
}

class Phone{

    double price;

    public void sendEmain(){
        System.out.println("发送邮件");
    }

    public void playGame(){
        System.out.println("玩游戏");
    }

    public void shouPrice(){
        System.out.println("手机的价格为" + price);
    }
}
